package Person.Buffer;

import java.io.*;
import java.util.ArrayList;
import java.util.Random;

public class DianMingQiDemo {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\win10\\IdeaProjects\\IDEA\\ming.txt"));

        ArrayList<String> array = new ArrayList<>();


        String line;
        while((line=br.readLine())!=null){
            array.add(line);
        }
        br.close();
        Random r = new Random();
        int index = r.nextInt(array.size());
        String name = array.get(index);

        System.out.println("幸运者是："+name);


    }
}
